package com.acwing.partition43;

import java.io.*;

/**
 * @author rkc
 * @date 2022/7/13 8:49
 */
public class AC4278峰会 {

    private static final int N = 210;
    private static boolean[][] g = new boolean[N][N];
    private static int[] temp = new int[N];
    private static boolean[] st = new boolean[N];
    private static int n, m, k, c;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = nextInt(); m = nextInt();
        for (int i = 0; i < m; i++) {
            int a = nextInt(), b = nextInt();
            g[a][b] = g[b][a] = true;
        }
        k = nextInt();
        for (int i = 0; i < k; i++) {
            c = nextInt();
            for (int j = 0; j < N; j++) st[j] = false;
            for (int j = 0; j < c; j++) {
                temp[j] = nextInt();
                st[temp[j]] = true;
            }
            int res = resolve();
            if (res == -1) writer.format("Area %d is OK.\n", i + 1);
            else if (res == -2) writer.format("Area %d needs help.\n", i + 1);
            else writer.format("Area %d may invite more people, such as %d.\n", i + 1, res);
        }
        writer.flush();
    }

    private static int resolve() {
        boolean flag = true;
        for (int i = 0; i < c; i++) {
            for (int j = i + 1; j < c; j++) {
                if (!g[temp[i]][temp[j]]) {
                    flag = false;
                    break;
                }
            }
        }
        if (flag) {
            //满足给定区域任意两个是直接朋友关系，检查是否可以加入更多人
            for (int i = 1; i <= n; i++) {
                if (!st[i]) {
                    //检查i是否能和当前划分区域所有人有直接朋友关系
                    boolean f = true;
                    for (int j = 0; j < c; j++) {
                        if (!g[temp[j]][i]) {
                            f = false;
                            break;
                        }
                    }
                    if (f) return i;
                }
            }
            return -1;
        }
        return -2;
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
